// 通用数据
const commonData = {
  state: {
    tabs: [],
    keepAliveMenu: ['编辑任务书', '创建验收表', '编辑验收表'],
    pageTitleObj: {}, // 改变整个页面左上角标题
    copyFileSingleTableData: [],
    fileSingle: {
      layerItem: false,
      tableArr: [],
      treeItem: {},
      startSingleID: ''
    },
    fileSingleTableItem: {},
    projectFileTitle: '', // 项目文件选择的文件名称
    expainModelVisible: false,
    primaryColor: '#386bd7',
    attorneyCopyOids:[],   //仿真管理复制的委托书
    docTimeData: [], // 文档签审页面添加交付物临时数据
    
    ipStatus: true, // 判断研发域
    savePageData: 0, // 项目列表分页后，为缓存页面，记住当前页面分页状态
  },
  getters: {
    copyFileSingleTableData(state){
      return state.copyFileSingleTableData
    },
    fileSingle(state){
      let obj = JSON.parse(sessionStorage.getItem('fileSingle'))
      state.fileSingle = state.fileSingle || obj
      return state.fileSingle
    },
    fileSingleTableItem(state){
      return state.copyFileSingleTableData
    }
  },
  mutations: {
    SET_TABS: (state, tabs) => {
      let data = JSON.stringify(tabs)
      sessionStorage.setItem('tabArr', data)
      state.tabs = tabs
    },
    SETPAGETITLEOBJ: (state, data) => {
      let obj = JSON.stringify(data)
      sessionStorage.setItem('pageTitleObj', obj)
      state.pageTitleObj = data
    },
    SET_COPYFILESINGLETABLEDATA: (state, data) => {
      state.copyFileSingleTableData = data
      sessionStorage.setItem('copyFileSingleTableData', JSON.stringify(data))
    },
    SET_FILESINGLE: (state, data) => {
      state.fileSingle = data
      sessionStorage.setItem('fileSingle', JSON.stringify(data))
    },
    SET_FILESINGLETABLEITEM: (state, data) => {
      state.fileSingleTableItem = data
      sessionStorage.setItem('fileSingleTableItem', JSON.stringify(data))
    },
    SET_PROJECT_FILE_TITLE: (state, data) => {
      state.projectFileTitle = data
      sessionStorage.setItem('projectFileTitle', data)
    },
    SETEXPAINMODELVISIBLE: (state, data) => {
      state.expainModelVisible = data
    },
    SET_ATTORNEY_OIDS:(state,data)=>{
      state.attorneyCopyOids = data
    },
    SETDOCTIMEDATA:(state, data) => {
      state.docTimeData = data
    },
    SETPRIMARYCOLOR:(state, data) => {
      state.primaryColor = data
    },
    SETINSTATUS:(state, data) => {
      state.ipStatus = data
    },
    SETPAGEDATA: (state, data) => {
      state.savePageData = data
    }
  }
}
export default commonData